package com.heima.wemedia.mapper;

import com.heima.model.wemedia.pojos.WmNews;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WmNewsMaterialMapper {

    @Delete("delete from wm_news_material where news_id = #{id}")
    void delete(Integer id);


    void saveNewsMaterials(@Param("materialIds") List<Integer> materialIds, @Param("newsId") Integer id, @Param("type") int type);

    @Insert("insert into wm_news values(null,#{userId},#{title},#{content},#{type},#{channelId},#{labels},#{createdTime},#{submitedTime},#{status},#{publishTime},#{reason},#{articleId},#{images},#{enable})")
    void save(WmNews wmNews);
}
